package com.data.controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CookieValue;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import com.data.entity.JsonItem;
import com.utils.JsonResult;
import com.data.service.ItemService;
import com.entity.Dataitems;

/**
 * @Title: ItemController.java
 * @Package com.data.controller
 * @author 孙梦楠
 * @date 2017年8月20日 下午3:58:48
 * @version V1.0.0
 */
@RestController
@RequestMapping(value = "/data/item")
public class ItemController {
	
	@Autowired
	private ItemService ItemService;

	// 列表
	@RequestMapping(value = "", method = RequestMethod.POST)
	public JsonResult<List<JsonItem>> listItemByConditions(@RequestBody Dataitems dataitems,
			@CookieValue(value = "opetypecookie", required = false) String opetypecookie,
			@CookieValue(value = "languagecookie", required = false) String languagecookie) {
		
		
		Integer dataitemid = dataitems.getDataitemid();
		
		return ItemService.listItemByProtocoltype(dataitemid,opetypecookie,languagecookie);
	}

	
}
